package a.f;

import a.c.*;
import a.c.v;
import a.c.z;

import java.awt.*;
import java.awt.geom.Rectangle2D;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;

public class x
  extends r
{
  private double g = 10.0D;
  private boolean h = true;
  private boolean i;
  private double j = 1.0D;
  private double k = 500.0D;
  private boolean l;
  double m = 5.0D;
  public static boolean n;
  
  public double b()
  {
    return this.m;
  }
  
  public void a(double paramDouble)
  {
    this.m = paramDouble;
  }
  
  public boolean c()
  {
    return this.l;
  }
  
  public void a(boolean paramBoolean)
  {
    this.l = paramBoolean;
  }
  
  public double d()
  {
    return this.g;
  }
  
  public void b(double paramDouble)
  {
    this.g = paramDouble;
  }
  
  public boolean e()
  {
    return this.h;
  }
  
  public boolean f()
  {
    return this.i;
  }
  
  public void b(boolean paramBoolean)
  {
    this.i = paramBoolean;
  }
  
  public double g()
  {
    return this.j;
  }
  
  public void c(double paramDouble)
  {
    this.j = paramDouble;
  }
  
  public double h()
  {
    return this.k;
  }
  
  public void d(double paramDouble)
  {
    this.k = paramDouble;
  }
  
  public void c(boolean paramBoolean)
  {
    this.h = paramBoolean;
  }
  
  public boolean canLayout(o paramo)
  {
    boolean bool = o.eg;
    if ((bool) || (a() != null)) {
      if (bool) {
        break label33;
      }
    }
    label33:
    return a().canLayout(paramo);
  }
  
  public void doLayout(o paramo)
  {
    boolean bool = o.eg;
    int i2 = o.dg;
    if ((bool) || (a() != null)) {
      a().doLayout(paramo);
    }
    if (((bool) || (paramo != null)) && (paramo.k() > 0))
    {
      double d1 = this.j;
      cb localcb1 = null;
      cb localcb2 = null;
      if (this.l)
      {
        localcb1 = new cb((byte)2);
        localcb2 = new cb((byte)1);
        localcb1.c(paramo);
        localcb2.c(paramo);
        d1 = 1.0D / this.j;
      }
      Rectangle localRectangle = paramo.d();
      double d2 = localRectangle.width / localRectangle.height;
      f_ localf_ = new f_(null);
      if (!bool) {
        if (!this.i)
        {
          if (bool) {
            break label546;
          }
          if (d1 >= d2) {
            break label542;
          }
        }
      }
      e_[][] arrayOfe_; = new e_[paramo.l()][];
      z localz = a(paramo, arrayOfe_;);
      localz.a(localf_);
      ArrayList localArrayList = new ArrayList();
      int i1 = 0;
      double d3 = ((c_)localz.a()).a;
      d_ locald_ = null;
      v localv = localz.f();
      if (localv != null) {}
      label388:
      while (bool)
      {
        c_ localc_ = (c_)localv.c();
        if (bool) {
          break label404;
        }
        if (i2 != 0) {
          break label403;
        }
        if (localc_.e)
        {
          if (!bool)
          {
            if (i1 == 0)
            {
              localz.a(locald_ = new d_(localc_.a, true), localv);
              d3 = localc_.a;
            }
            i1++;
          }
          if (bool) {
            break label388;
          }
          if (i2 == 0) {}
        }
        else
        {
          i1--;
          if (bool) {
            break label388;
          }
          if (i1 == 0)
          {
            locald_.d = localc_.a;
            locald_ = null;
            localv = localz.b(new d_(localc_.a, false), localv);
            localArrayList.add(new double[] { d3, localc_.a });
          }
        }
        localv = localv.a();
        if (i2 == 0) {
          break;
        }
      }
      label403:
      if (localArrayList.size() > 1)
      {
        label404:
        a(paramo, arrayOfe_;, localz);
        localz.a(localf_);
        g_[] arrayOfg_1 = new g_[paramo.j()];
        if (!bool) {
          if (this.i)
          {
            arrayOfg_2 = c(localz, arrayOfe_;, arrayOfg_1, this.k);
            break label476;
          }
        }
        g_[] arrayOfg_2 = a(localz, arrayOfe_;, arrayOfg_1, d1);
        label476:
        a(paramo, arrayOfg_1, arrayOfe_;);
        a(paramo, arrayOfe_;, arrayOfg_2);
        b(paramo, arrayOfe_;);
        c(arrayOfg_2);
        b(arrayOfg_2);
        a(paramo, arrayOfe_;, arrayOfg_2, arrayOfg_1);
        a(arrayOfg_2, paramo);
        new hb().doLayout(paramo);
      }
      label542:
      if (this.l)
      {
        label546:
        localcb2.i(paramo);
        localcb1.i(paramo);
      }
    }
  }
  
  private g_[] a(z paramz, e_[][] paramArrayOfe_, g_[] paramArrayOfg_, double paramDouble)
  {
    boolean bool = o.eg;
    int i2 = o.dg;
    double d1 = 50.0D;
    g_[] arrayOfg_ = c(paramz, paramArrayOfe_, paramArrayOfg_, d1);
    Rectangle2D.Double localDouble = a(arrayOfg_);
    double d2 = localDouble.width / localDouble.height;
    if (!bool) {
      if (paramDouble < d2) {
        return arrayOfg_;
      }
    }
    double d3 = ((b_)paramz.g().c()).a - ((b_)paramz.f().c()).a + 1000.0D;
    arrayOfg_ = c(paramz, paramArrayOfe_, paramArrayOfg_, d3);
    localDouble = a(arrayOfg_);
    double d4 = localDouble.width / localDouble.height;
    if (!bool) {
      if (paramDouble > d4) {
        return arrayOfg_;
      }
    }
    double d5 = d3;
    double d6 = d4;
    if (!bool) {
      if (Math.abs(d2 / paramDouble - 1.0D) < Math.abs(d6 / paramDouble - 1.0D))
      {
        d5 = d1;
        d6 = d2;
      }
    }
    int i1 = 0;
    label332:
    label341:
    do
    {
      if (i1 >= 20) {
        break;
      }
      double d7 = d3 * 0.5D + d1 * 0.5D;
      if (bool) {
        break label369;
      }
      arrayOfg_ = c(paramz, paramArrayOfe_, paramArrayOfg_, d7);
      if (i2 != 0) {
        break label361;
      }
      localDouble = a(arrayOfg_);
      double d8 = localDouble.width / localDouble.height;
      if (!bool)
      {
        if (Math.abs(d8 / paramDouble - 1.0D) < Math.abs(d6 / paramDouble - 1.0D))
        {
          d5 = d7;
          d6 = d8;
        }
        if (bool) {}
      }
      else
      {
        if (d8 > paramDouble)
        {
          d4 = d8;
          d3 = d7;
          if (bool) {
            break label341;
          }
          if (i2 == 0) {
            break label332;
          }
        }
        d2 = d8;
      }
      d1 = d7;
      if (!bool)
      {
        if (d3 - d1 < 10.0D) {
          break;
        }
        i1++;
      }
    } while (i2 == 0);
    label361:
    label369:
    return c(paramz, paramArrayOfe_, paramArrayOfg_, d5);
  }
  
  private Rectangle2D.Double a(g_[] paramArrayOfg_)
  {
    boolean bool = o.eg;
    int i2 = o.dg;
    b(paramArrayOfg_);
    Rectangle2D.Double localDouble1 = new Rectangle2D.Double(0.0D, 0.0D, -1.0D, -1.0D);
    int i1 = 0;
    g_ localg_1;
    label286:
    label287:
    label451:
    do
    {
      do
      {
        if (i1 >= paramArrayOfg_.length) {
          break;
        }
        localg_1 = paramArrayOfg_[i1];
        Rectangle2D.Double localDouble2 = (Rectangle2D.Double)localg_1.k.clone();
        localDouble2.x += localg_1.b;
        localDouble2.y += localg_1.c;
        if (bool) {
          break label500;
        }
        if (i2 != 0) {
          break label487;
        }
        if ((bool) || (localg_1.l != null))
        {
          if (bool) {
            break label287;
          }
          if (localg_1.l.size() > 0)
          {
            if (!bool) {
              if (!this.h)
              {
                localDouble2.width += this.m * localg_1.l.size() + this.g;
                if (bool) {
                  break label287;
                }
                if (i2 == 0) {
                  break label286;
                }
              }
            }
            if (!bool)
            {
              if ((i1 & 0x1) == 1)
              {
                localDouble2.x -= this.m * localg_1.l.size() + this.g;
                localDouble2.width += this.m * localg_1.l.size() + this.g;
              }
            }
            else
            {
              if (bool) {
                break label287;
              }
              if (i2 == 0) {
                break label286;
              }
            }
            localDouble2.width += this.m * localg_1.l.size() + this.g;
          }
        }
        if (!bool)
        {
          if (i1 > 0)
          {
            if (bool) {
              continue;
            }
            if (!this.h)
            {
              localg_2 = paramArrayOfg_[(i1 - 1)];
              if (bool) {
                continue;
              }
              if (localg_2.l != null)
              {
                if (bool) {
                  continue;
                }
                if (localg_2.l.size() > 0)
                {
                  if (!bool)
                  {
                    if ((i1 & 0x1) == 0)
                    {
                      localDouble2.x -= this.m * localg_2.l.size() + this.g;
                      localDouble2.width += this.m * localg_2.l.size() + this.g;
                    }
                  }
                  else
                  {
                    if (bool) {
                      continue;
                    }
                    if (i2 == 0) {
                      break label451;
                    }
                  }
                  localDouble2.width += this.m * localg_2.l.size() + this.g;
                }
              }
            }
          }
          k.a(localDouble1, localDouble2, localDouble1);
          i1++;
        }
      } while (i2 == 0);
    } while (bool);
    label487:
    label500:
    for (i1 = 0; i2 == 0; i1++)
    {
      g_ localg_2;
      if (i1 >= paramArrayOfg_.length) {
        break;
      }
      localg_1 = paramArrayOfg_[i1];
      localg_1.b = (localg_1.c = 0.0D);
    }
    return localDouble1;
  }
  
  private z a(o paramo, e_[][] paramArrayOfe_)
  {
    boolean bool = o.eg;
    int i1 = o.dg;
    z localz = new z();
    a.c.w localw = paramo.v();
    do
    {
      if (!localw.e()) {
        break;
      }
      e locale = localw.d();
      zc localzc = paramo.k(locale);
      localz.add(new c_(locale, localzc.a(), true));
      if (!bool)
      {
        if (i1 != 0) {
          break label126;
        }
        localz.add(new c_(locale, localzc.a() + localzc.c(), false));
        localw.f();
      }
    } while (i1 == 0);
    label126:
    return localz;
  }
  
  private void a(o paramo, e_[][] paramArrayOfe_, z paramz)
  {
    boolean bool = o.eg;
    int i2 = o.dg;
    m localm = paramo.w();
    label217:
    label219:
    do
    {
      if (!localm.e()) {
        break;
      }
      d locald = localm.a();
      e_[] arrayOfe_ = new e_[paramo.b(locald).a() + 2];
      paramArrayOfe_[locald.d()] = arrayOfe_;
      paramz.add(arrayOfe_[0] =  = new e_(locald, paramo.r(locald), 0, (byte)0));
      z localz = paramo.m(locald);
      int i1 = 0;
      v localv = localz.f();
      if (localv != null) {}
      do
      {
        a.d.w localw = (a.d.w)localv.c();
        paramz.add(arrayOfe_[(i1 + 1)] =  = new e_(locald, localw, i1, (byte)1));
        localv = localv.a();
        i1++;
        if (bool) {
          break label219;
        }
        if (i2 != 0) {
          break label217;
        }
        if (i2 == 0) {
          break;
        }
        paramz.add(arrayOfe_[(i1 + 1)] =  = new e_(locald, paramo.s(locald), i1, (byte)2));
      } while (bool);
      localm.f();
    } while (i2 == 0);
  }
  
  private void a(g_[] paramArrayOfg_, o paramo)
  {
    boolean bool = o.eg;
    int i2 = o.dg;
    int i1 = 1;
    label362:
    label364:
    do
    {
      if (i1 >= paramArrayOfg_.length) {
        break;
      }
      g_ localg_;
      Object localObject1;
      Object localObject2;
      do
      {
        localg_ = paramArrayOfg_[i1];
        if ((bool) || (((i1 & 0x1) == 0) || (!this.h)))
        {
          double d1 = localg_.b;
          double d2 = localg_.c;
          v localv2 = localg_.g.f();
          do
          {
            if (localv2 == null) {
              break;
            }
            localObject1 = (e)localv2.c();
            localObject2 = paramo.k((e)localObject1);
            ((zc)localObject2).a(((zc)localObject2).a() + d1, ((zc)localObject2).b() + d2);
            localv2 = localv2.a();
            if (bool) {
              break label449;
            }
            if (i2 != 0) {
              break label447;
            }
          } while (i2 == 0);
        }
      } while (bool);
      v localv1 = localg_.g.f();
      do
      {
        do
        {
          if (localv1 == null) {
            break label439;
          }
          e locale = (e)localv1.c();
          zc localzc = paramo.k(locale);
          double d3 = localg_.k.x + localg_.b + (localg_.k.getMaxX() - (localzc.a() + localzc.c()));
          localzc.a(d3, localg_.c + localg_.k.y + (localg_.k.y + localg_.k.height) - (localzc.b() + localzc.d()));
          if (bool) {
            break label449;
          }
          if (i2 != 0) {
            break label447;
          }
          localObject1 = locale.i();
          do
          {
            do
            {
              if (localObject1 == null) {
                break;
              }
              localObject2 = paramo.q((d)localObject1);
              paramo.b((d)localObject1, new a.d.w(-((a.d.w)localObject2).a, -((a.d.w)localObject2).b));
              if (bool) {
                break label364;
              }
              localObject1 = ((d)localObject1).j();
              if (i2 != 0) {
                break label362;
              }
            } while (i2 == 0);
          } while (bool);
          localObject1 = locale.h();
          do
          {
            if (localObject1 == null) {
              break;
            }
            localObject2 = paramo.p((d)localObject1);
            paramo.a((d)localObject1, new a.d.w(-((a.d.w)localObject2).a, -((a.d.w)localObject2).b));
            localObject1 = ((d)localObject1).i();
            if (bool) {
              break label436;
            }
            if (i2 != 0) {
              break label434;
            }
          } while (i2 == 0);
        } while (bool);
        localv1 = localv1.a();
      } while (i2 == 0);
      if (!bool) {
        i1++;
      }
    } while (i2 == 0);
    label434:
    label436:
    label439:
    label447:
    label449:
    return;
  }
  
  private void a(o paramo, e_[][] paramArrayOfe_, g_[] paramArrayOfg_1, g_[] paramArrayOfg_2)
  {
    boolean bool = o.eg;
    int i2 = o.dg;
    m localm = paramo.w();
    label350:
    label365:
    do
    {
      if (!localm.e()) {
        break;
      }
      d locald = localm.a();
      int i1 = 1;
      z localz1 = paramo.m(locald);
      z localz2 = new z();
      e_[] arrayOfe_ = paramArrayOfe_[locald.d()];
      Object localObject1;
      Object localObject2;
      Object localObject3;
      Object localObject4;
      Object localObject5;
      do
      {
        localObject1 = arrayOfe_[0].b;
        localObject2 = paramo.r(locald);
        localObject3 = localz1.f();
        do
        {
          if (localObject3 == null) {
            break label365;
          }
          localObject4 = (a.d.w)((v)localObject3).c();
          localObject5 = arrayOfe_[i1];
          g_ localg_ = ((e_)localObject5).b;
          a(localg_, (g_)localObject1, paramArrayOfg_1, (a.d.w)localObject2, (a.d.w)localObject4, localz2, ((e_)localObject5).k);
          localObject2 = localObject4;
          localObject1 = localg_;
          if (i2 != 0) {
            break;
          }
          if (this.h)
          {
            if (!bool) {
              if ((localg_.e & 0x1) == 0)
              {
                localz2.add(new a.d.w(((a.d.w)localObject4).a + localg_.b, ((a.d.w)localObject4).b + localg_.c));
                if (bool) {
                  continue;
                }
                if (i2 == 0) {
                  break label350;
                }
              }
            }
            double d1 = localg_.c + localg_.k.y + (localg_.k.y + localg_.k.height - ((a.d.w)localObject4).b);
            double d2 = localg_.k.x + localg_.b + (localg_.k.getMaxX() - ((a.d.w)localObject4).a);
            localz2.add(new a.d.w(d2, d1));
            if (bool) {
              continue;
            }
            if (i2 == 0) {}
          }
          else
          {
            localz2.add(new a.d.w(((a.d.w)localObject4).a + localg_.b, ((a.d.w)localObject4).b + localg_.c));
          }
          localObject3 = ((v)localObject3).a();
          i1++;
        } while (i2 == 0);
        localObject3 = paramo.s(locald);
        localObject4 = arrayOfe_[(arrayOfe_.length - 1)];
        localObject5 = ((e_)localObject4).b;
        if (bool) {
          break label451;
        }
      } while (bool);
      if (arrayOfe_[(arrayOfe_.length - 1)].b != localObject1) {
        a((g_)localObject5, (g_)localObject1, paramArrayOfg_1, (a.d.w)localObject2, (a.d.w)localObject3, localz2, ((e_)localObject4).k);
      }
      paramo.b(locald, localz2);
      localm.f();
    } while (i2 == 0);
    label451:
  }
  
  private void b(g_[] paramArrayOfg_)
  {
    boolean bool = o.eg;
    int i3 = o.dg;
    int i1 = 1;
    g_ localg_1;
    g_ localg_2;
    label227:
    label234:
    do
    {
      if (i1 >= paramArrayOfg_.length) {
        break;
      }
      localg_1 = paramArrayOfg_[(i1 - 1)];
      localg_2 = paramArrayOfg_[i1];
      localg_2.e = i1;
      if (i3 != 0) {
        break label258;
      }
      if (localg_2.k.width >= 0.0D)
      {
        double d1 = localg_1.k.x + localg_1.b - localg_2.k.x;
        double d2;
        if (!bool) {
          if (this.h)
          {
            d2 = localg_1.k.getMaxY() + localg_1.c - localg_2.k.y + this.g;
            if (bool) {
              break label234;
            }
            if (i3 == 0) {
              break label227;
            }
          }
        }
        int i2 = localg_1.l.size();
        if (i2 > 0)
        {
          d2 = localg_1.c + localg_1.k.getMaxY() - localg_2.k.y + i2 * this.m - this.m + this.g * 2.0D;
          if (bool) {
            break label234;
          }
          if (i3 == 0) {}
        }
        else
        {
          d2 = localg_1.c + localg_1.k.getMaxY() - localg_2.k.y + this.g;
        }
        localg_2.b = d1;
        localg_2.c = d2;
      }
      i1++;
    } while (i3 == 0);
    if ((!bool) && (!this.h)) {
      label258:
      i1 = 1;
    }
    while (i1 < paramArrayOfg_.length)
    {
      localg_1 = paramArrayOfg_[(i1 - 1)];
      localg_2 = paramArrayOfg_[i1];
      if (!bool)
      {
        if (localg_1.l.size() > 0) {
          localg_2.b += localg_1.l.size() * this.m - this.m + this.g;
        }
        i1++;
      }
      if (i3 != 0)
      {
        i1 = 1;
        do
        {
          if (i1 >= paramArrayOfg_.length) {
            break;
          }
          if (!bool) {}
          localg_1 = paramArrayOfg_[(i1 - 1)];
          localg_2 = paramArrayOfg_[i1];
          if (!bool)
          {
            if (localg_1.l != null)
            {
              if (bool) {
                continue;
              }
              if (localg_1.l.size() > 0) {
                localg_2.b += localg_1.l.size() * this.m - this.m + this.g;
              }
            }
            i1++;
          }
        } while (i3 == 0);
      }
    }
  }
  
  private void c(g_[] paramArrayOfg_)
  {
    boolean bool = o.eg;
    int i3 = o.dg;
    int i1 = 0;
    label160:
    do
    {
      if (i1 >= paramArrayOfg_.length) {
        break;
      }
      g_ localg_ = paramArrayOfg_[i1];
      localg_.j.a(new Comparator()
      {
        public int compare(Object paramAnonymousObject1, Object paramAnonymousObject2)
        {
          x.e_ locale_1 = (x.e_)paramAnonymousObject1;
          x.e_ locale_2 = (x.e_)paramAnonymousObject2;
          return l.a(locale_1.j, locale_2.j);
        }
      });
      int i2 = -1;
      double d1 = -1.797693134862316E+308D;
      double d2 = 1.7976931348623157E+308D;
      double d3 = 1.7976931348623157E+308D;
      v localv = localg_.j.f();
      if (localv != null) {}
      while (bool)
      {
        e_ locale_ = (e_)localv.c();
        if (i3 != 0) {
          break label160;
        }
        if (d3 != locale_.j)
        {
          i2++;
          d3 = locale_.j;
        }
        locale_.k = i2;
        d1 = Math.max(d1, locale_.j);
        d2 = Math.min(d2, locale_.j);
        localv = localv.a();
        if (i3 == 0) {
          break;
        }
      }
      if (localg_.j.size() > 0)
      {
        if (!bool)
        {
          if (i1 > 0)
          {
            k.a(localg_.k, new Rectangle2D.Double(paramArrayOfg_[(i1 - 1)].a, d2, 0.0D, d1 - d2), localg_.k);
            k.a(localg_.k, new Rectangle2D.Double(localg_.a, d2, 0.0D, d1 - d2), localg_.k);
          }
        }
        else
        {
          if (bool) {
            break label280;
          }
          if (i3 == 0) {
            break label279;
          }
        }
        k.a(localg_.k, new Rectangle2D.Double(localg_.a, d2, 0.0D, d1 - d2), localg_.k);
        if (bool) {
          continue;
        }
        if (i1 < paramArrayOfg_.length - 1) {
          k.a(paramArrayOfg_[(i1 + 1)].k, new Rectangle2D.Double(localg_.a, d2, 0.0D, d1 - d2), paramArrayOfg_[(i1 + 1)].k);
        }
      }
      i1++;
    } while (i3 == 0);
    label279:
    label280:
    return;
  }
  
  private void b(o paramo, e_[][] paramArrayOfe_)
  {
    boolean bool = o.eg;
    int i3 = o.dg;
    m localm = paramo.w();
    label162:
    label175:
    do
    {
      if (!localm.e()) {
        break;
      }
      d locald = localm.a();
      e_[] arrayOfe_ = paramArrayOfe_[locald.d()];
      Object localObject = arrayOfe_[0];
      int i1 = 1;
      do
      {
        do
        {
          if (i1 >= arrayOfe_.length) {
            break label175;
          }
          e_ locale_ = arrayOfe_[i1];
          int i2 = locale_.b.e - ((e_)localObject).b.e;
          if (i3 != 0) {
            break;
          }
          if (i2 != 0)
          {
            a.d.w localw1 = ((e_)localObject).g;
            a.d.w localw2 = locale_.g;
            g_ localg_;
            if (i2 > 0)
            {
              localg_ = ((e_)localObject).b;
              if (bool) {
                break label162;
              }
              if (i3 == 0) {}
            }
            else
            {
              localg_ = locale_.b;
            }
            locale_.j = a(localw2, localw1, localg_);
            localg_.j.add(locale_);
          }
          localObject = locale_;
          i1++;
        } while (i3 == 0);
        localm.f();
      } while (bool);
    } while (i3 == 0);
  }
  
  private void a(o paramo, e_[][] paramArrayOfe_, g_[] paramArrayOfg_)
  {
    boolean bool = o.eg;
    int i4 = o.dg;
    m localm = paramo.w();
    label491:
    do
    {
      if (!localm.e()) {
        break;
      }
      d locald = localm.a();
      e_[] arrayOfe_ = paramArrayOfe_[locald.d()];
      e_ locale_1 = arrayOfe_[0];
      int i1 = 1;
      do
      {
        do
        {
          if (i1 >= arrayOfe_.length) {
            break label608;
          }
          e_ locale_2 = arrayOfe_[i1];
          if (i4 != 0) {
            break;
          }
          int i2 = locale_2.b.e - locale_1.b.e;
          while (i2 <= 1) {
            if (i4 == 0) {
              if (i2 >= -1) {
                break label588;
              }
            }
          }
          do
          {
            if (i2 > 0)
            {
              localArrayList = new ArrayList(Arrays.asList(arrayOfe_));
              localg_ = paramArrayOfg_[(locale_1.b.e + 1)];
              localObject1 = locale_1.g;
              Object localObject2 = locale_1.b;
              double d2 = a(locale_2.g, (a.d.w)localObject1, (g_)localObject2);
              localw = new a.d.w(((g_)localObject2).a, d2);
              localObject1 = locale_1 = new e_(locald, localw, i1, (byte)1);
              ((e_)localObject1).b = localg_;
              localArrayList.add(i1, localObject1);
              localObject2 = paramo.m(locald);
              ((z)localObject2).add(i1 - 1, localw);
              paramo.b(locald, (z)localObject2);
              i3 = i1 + 1;
              if (i3 < localArrayList.size())
              {
                ((e_)localArrayList.get(i3)).h = i3;
                i3++;
              }
              for (;;)
              {
                if (!bool) {
                  if (i4 == 0)
                  {
                    if (i4 == 0) {
                      break;
                    }
                    arrayOfe_ = (e_[])localArrayList.toArray(new e_[localArrayList.size()]);
                    paramArrayOfe_[locald.d()] = arrayOfe_;
                    i1++;
                    if (bool) {
                      continue;
                    }
                    i2--;
                  }
                }
              }
              if (bool) {
                break label491;
              }
              if (i4 == 0) {
                break;
              }
            }
            ArrayList localArrayList = new ArrayList(Arrays.asList(arrayOfe_));
            g_ localg_ = paramArrayOfg_[(locale_1.b.e - 1)];
            Object localObject1 = locale_1.g;
            double d1 = a(locale_2.g, (a.d.w)localObject1, localg_);
            a.d.w localw = new a.d.w(localg_.a, d1);
            localObject1 = locale_1 = new e_(locald, localw, i1, (byte)1);
            ((e_)localObject1).b = localg_;
            localArrayList.add(i1, localObject1);
            z localz = paramo.m(locald);
            localz.add(i1 - 1, localw);
            paramo.b(locald, localz);
            int i3 = i1 + 1;
            if (i3 < localArrayList.size())
            {
              ((e_)localArrayList.get(i3)).h = i3;
              i3++;
            }
            for (;;)
            {
              if (!bool) {
                if (i4 == 0)
                {
                  if (i4 == 0) {
                    break;
                  }
                  arrayOfe_ = (e_[])localArrayList.toArray(new e_[localArrayList.size()]);
                  paramArrayOfe_[locald.d()] = arrayOfe_;
                  i1++;
                  if (bool) {
                    continue;
                  }
                  i2++;
                }
              }
            }
            if (i4 == 0) {
              break;
            }
            locale_1 = arrayOfe_[i1];
            i1++;
          } while (bool);
        } while (i4 == 0);
        localm.f();
      } while (bool);
    } while (i4 == 0);
    label588:
    label608:
    return;
  }
  
  private void a(o paramo, g_[] paramArrayOfg_, e_[][] paramArrayOfe_)
  {
    boolean bool = o.eg;
    int i1 = o.dg;
    a.c.w localw = paramo.v();
    label112:
    label114:
    do
    {
      do
      {
        if (!localw.e()) {
          return;
        }
        e locale = localw.d();
        g_ localg_ = paramArrayOfg_[locale.f()];
        d locald = locale.i();
        do
        {
          do
          {
            if (locald == null) {
              break;
            }
            e_[] arrayOfe_ = paramArrayOfe_[locald.d()];
            arrayOfe_[(arrayOfe_.length - 1)].b = localg_;
            if (bool) {
              break label114;
            }
            locald = locald.j();
            if (i1 != 0) {
              break label112;
            }
          } while (i1 == 0);
        } while (bool);
        locald = locale.h();
        do
        {
          if (locald == null) {
            break;
          }
          paramArrayOfe_[locald.d()][0].b = localg_;
          locald = locald.i();
          if (bool) {
            break label167;
          }
          if (i1 != 0) {
            break label165;
          }
        } while (i1 == 0);
      } while (bool);
      localw.f();
    } while (i1 == 0);
    label165:
    label167:
    return;
  }
  
  private g_[] c(z paramz, e_[][] paramArrayOfe_, g_[] paramArrayOfg_, double paramDouble)
  {
    boolean bool = o.eg;
    int i2 = o.dg;
    ArrayList localArrayList = new ArrayList();
    Object localObject = new z();
    z localz1 = new z();
    double d1 = -1.797693134862316E+308D;
    b_ localb_1 = (b_)paramz.a();
    double d2 = localb_1.a;
    double d3 = 0.0D;
    g_ localg_ = new g_(1.7976931348623157E+308D);
    localArrayList.add(localg_);
    double d4 = d2;
    v localv = paramz.f();
    if (localv != null) {}
    label486:
    while (bool)
    {
      b_ localb_2 = (b_)localv.c();
      if (!bool)
      {
        if (i2 != 0) {
          break label535;
        }
        if (bool) {}
      }
      else if (d1 < localb_2.a)
      {
        if (bool) {
          break label486;
        }
        if (localb_2.a > d4)
        {
          int i1 = localz1.size();
          double d5 = (bool) || (i1 > 0) ? i1 * this.m - this.m + this.g : 0.0D;
          double d6 = Math.max(paramDouble - d3 - d5, 100.0D);
          z localz2;
          do
          {
            do
            {
              if (localb_2.a < d2 + d6) {
                break;
              }
              localz2 = localz1;
              localz1 = new z(localz1);
              d1 = Math.max(d1, d2 + d6);
              d3 = d5;
              d2 = d1;
              d6 = Math.max(paramDouble - d3 - d5, 100.0D);
              d6 = Math.max(d6, d2 - localb_2.a() + 1.0D);
              localg_.l = localz2;
              localg_.a = d1;
              localg_ = a(localg_, localArrayList, localz1, d1);
              if (bool) {
                break label520;
              }
              if (i2 != 0) {
                break label518;
              }
            } while (i2 == 0);
            if (bool) {
              break;
            }
          } while (bool);
          if (localb_2.a > d2)
          {
            if (bool) {
              break label486;
            }
            if (localb_2.a() > d2 + d6)
            {
              localz2 = localz1;
              localz1 = new z(localz1);
              d1 = localb_2.a;
              d3 = d5;
              d2 = d1;
              if (bool) {
                break label486;
              }
              if (localg_.k.height >= 0.0D)
              {
                d6 = Math.max(paramDouble - d3 - d5, 100.0D);
                d6 = Math.max(d6, d2 - localb_2.a() + 1.0D);
                localg_.l = localz2;
                localg_.a = d1;
                localg_ = a(localg_, localArrayList, localz1, d1);
              }
            }
          }
        }
      }
      d4 = Math.max(d4, localb_2.a());
      d1 = localb_2.a;
      localb_2.a((z)localObject, localz1, localg_, paramArrayOfe_, paramArrayOfg_);
      localv = localv.a();
      if (i2 == 0) {
        break;
      }
    }
    label518:
    label520:
    localg_.a = d1;
    label535:
    localObject = (g_[])localArrayList.toArray(new g_[localArrayList.size()]);
    return localObject;
  }
  
  private g_ a(g_ paramg_, ArrayList paramArrayList, z paramz, double paramDouble)
  {
    boolean bool = o.eg;
    int i1 = o.dg;
    g_ localg_ = paramg_;
    paramg_ = new g_(1.7976931348623157E+308D);
    if (!bool)
    {
      paramg_.e = paramArrayList.size();
      paramArrayList.add(paramg_);
      if (paramz.size() > 0)
      {
        double d1 = 1.7976931348623157E+308D;
        double d2 = -1.797693134862316E+308D;
        Object localObject = paramz.f();
        label143:
        do
        {
          if (localObject == null) {
            break;
          }
          e_ locale_ = (e_)((v)localObject).c();
          d locald = locale_.f;
          o localo = (o)locald.c();
          z localz = localo.o(locald);
          a.d.w localw1 = locale_.g;
          if (!bool)
          {
            if (i1 != 0) {
              return paramg_;
            }
            if (bool) {
              break label143;
            }
          }
          a.d.w localw2 = (a.d.w)(locale_.i == 0 ? localz.get(1) : localz.get(locale_.h));
          double d3 = a(localw1, localw2, localg_);
          d1 = Math.min(d1, d3);
          d2 = Math.max(d2, d3);
          localObject = ((v)localObject).a();
        } while (i1 == 0);
        localObject = localg_.k;
        k.a((Rectangle2D)localObject, new Rectangle2D.Double(localg_.a, d1, 1.0D, d2 - d1), (Rectangle2D)localObject);
        if (bool) {
          break label261;
        }
        paramg_.k.setFrame(paramDouble, d1, 1.0D, d2 - d1);
      }
    }
    label261:
    return paramg_;
  }
  
  private double a(a.d.w paramw1, a.d.w paramw2, g_ paramg_)
  {
    boolean bool = o.eg;
    if (!bool) {
      if (paramw1.a == paramw2.a)
      {
        if (bool) {
          break label82;
        }
        d = (paramw2.b + paramw1.b) * 0.5D;
        if (o.dg == 0) {
          break label84;
        }
      }
    }
    label82:
    double d = paramw2.b + (paramw1.b - paramw2.b) * (paramg_.a - paramw2.a) / (paramw1.a - paramw2.a);
    label84:
    return d;
  }
  
  private void a(g_ paramg_1, g_ paramg_2, g_[] paramArrayOfg_, a.d.w paramw1, a.d.w paramw2, z paramz, int paramInt)
  {
    boolean bool = o.eg;
    int i3 = o.dg;
    int i1 = paramg_1.e - paramg_2.e;
    if ((bool) || (i1 != 0))
    {
      double d1 = paramInt * this.m;
      g_ localg_1;
      Rectangle2D.Double localDouble;
      double d7;
      double d8;
      double d9;
      if (!bool) {
        if (i1 > 0)
        {
          i2 = paramg_2.e;
          label801:
          do
          {
            if (i2 >= paramg_1.e) {
              break;
            }
            localg_1 = paramArrayOfg_[i2];
            double d2 = localg_1.j.size() * this.m - this.m;
            double d4 = a(paramw1, paramw2, localg_1);
            g_ localg_3 = paramArrayOfg_[(i2 + 1)];
            localDouble = localg_1.k;
            if (!bool) {
              if (this.h)
              {
                if ((bool) || ((paramg_1.e & 0x1) == 1))
                {
                  paramz.add(new a.d.w(localg_1.a + localg_1.b, d4 + localg_1.c));
                  d7 = Math.max(localg_1.k.getMaxX() + localg_1.b + this.g, localg_3.k.getMaxX() + localg_3.b + this.g);
                  paramz.add(new a.d.w(d7 + d2 - d1, d4 + localg_1.c));
                  d8 = localg_3.c + localg_3.k.y + (localg_3.k.y + localg_3.k.height - d4);
                  paramz.add(new a.d.w(d7 + d2 - d1, d8));
                  paramz.add(new a.d.w(localg_3.b + localg_3.k.x + (localg_3.k.getMaxX() - localg_1.a), d8));
                  if (bool) {
                    continue;
                  }
                  if (i3 == 0) {
                    break label801;
                  }
                }
                d7 = localDouble.y + localg_1.c + (localDouble.y + localDouble.height - d4);
                paramz.add(new a.d.w(localg_1.k.x + localg_1.b + (localDouble.getMaxX() - localg_1.a), d7));
                d8 = Math.min(localg_1.k.x + localg_1.b - this.g, localg_3.k.x + localg_3.b - this.g);
                paramz.add(new a.d.w(d8 - d1, d7));
                d9 = d4 + localg_3.c;
                paramz.add(new a.d.w(d8 - d1, d9));
                paramz.add(new a.d.w(localg_1.a + localg_3.b, d9));
                if (bool) {
                  continue;
                }
                if (i3 == 0) {
                  break label801;
                }
              }
            }
            paramz.add(new a.d.w(localg_1.a + localg_1.b, d4 + localg_1.c));
            d7 = localDouble.getMaxX() + localg_1.b + this.g;
            paramz.add(new a.d.w(d7 + d2 - d1, d4 + localg_1.c));
            d8 = localg_1.c + localDouble.getMaxY() + this.g + d2 - d1;
            paramz.add(new a.d.w(d7 + d2 - d1, d8));
            paramz.add(new a.d.w(localg_3.k.x + localg_3.b - this.g - d1, d8));
            paramz.add(new a.d.w(localg_3.k.x + localg_3.b - this.g - d1, d4 + localg_3.c));
            paramz.add(new a.d.w(localg_1.a + localg_3.b, d4 + localg_3.c));
            i2++;
          } while (i3 == 0);
        }
      }
      int i2 = paramg_2.e;
      do
      {
        if (i2 <= paramg_1.e) {
          break;
        }
        localg_1 = paramArrayOfg_[i2];
        g_ localg_2 = paramArrayOfg_[(i2 - 1)];
        double d3 = localg_2.j.size() * this.m - this.m;
        double d5 = a(paramw2, paramw1, localg_2);
        if (!bool)
        {
          if (this.h)
          {
            localDouble = localg_2.k;
            if ((paramg_1.e & 0x1) == 1)
            {
              d7 = localDouble.y + localg_2.c + (localDouble.y + localDouble.height - d5);
              paramz.add(new a.d.w(localg_2.a + localg_1.b, d5 + localg_1.c));
              d8 = Math.min(localg_2.k.x + localg_2.b, localg_1.k.x + localg_1.b);
              paramz.add(new a.d.w(d8 - this.g - d1, d5 + localg_1.c));
              paramz.add(new a.d.w(d8 - this.g - d1, d7));
              paramz.add(new a.d.w(localg_2.b + localg_2.k.x + (localg_2.k.getMaxX() - localg_2.a), d7));
              if (bool) {
                continue;
              }
              if (i3 == 0) {}
            }
            else
            {
              d7 = d5 + localg_2.c;
              d8 = localg_1.c + localg_1.k.y + (localg_1.k.y + localg_1.k.height - d5);
              d9 = Math.max(localg_1.k.getMaxX() + localg_1.b, localg_2.k.getMaxX() + localg_2.b);
              paramz.add(new a.d.w(localg_1.b + localg_1.a + localg_1.k.getMaxX() - localg_1.a, d8));
              paramz.add(new a.d.w(d9 + this.g + d3 - d1, d8));
              paramz.add(new a.d.w(d9 + this.g + d3 - d1, d7));
              paramz.add(new a.d.w(localg_2.a + localg_2.b, d7));
              if (bool) {
                continue;
              }
              if (i3 == 0) {}
            }
          }
          else
          {
            paramz.add(new a.d.w(localg_2.a + localg_1.b, d5 + localg_1.c));
          }
        }
        else
        {
          paramz.add(new a.d.w(localg_1.k.x + localg_1.b - this.g - d1, d5 + localg_1.c));
          double d6 = localg_2.c + localg_2.k.getMaxY() + this.g + d3 - d1;
          paramz.add(new a.d.w(localg_1.k.x + localg_1.b - this.g - d1, d6));
          paramz.add(new a.d.w(localg_2.k.getMaxX() + localg_2.b + this.g + d3 - d1, d6));
          paramz.add(new a.d.w(localg_2.k.getMaxX() + localg_2.b + this.g + d3 - d1, d5 + localg_2.c));
          paramz.add(new a.d.w(localg_2.a + localg_2.b, d5 + localg_2.c));
        }
        i2--;
      } while (i3 == 0);
    }
  }
  
  private static class c_
    extends x.b_
  {
    final e c;
    boolean e;
    
    public c_(e parame, double paramDouble, boolean paramBoolean)
    {
      super();
      this.c = parame;
      this.e = paramBoolean;
    }
    
    public double a()
    {
      if (!o.eg) {
        if (this.e)
        {
          o localo = (o)this.c.g();
          return localo.d(this.c).c() + this.a;
        }
      }
      return this.a;
    }
    
    public String toString()
    {
      return "NodeEvent{node=" + this.c + ", begin=" + this.e + ", x=" + this.a + '}';
    }
    
    public void a(z paramz1, z paramz2, x.g_ paramg_, x.e_[][] paramArrayOfe_, x.g_[] paramArrayOfg_)
    {
      boolean bool = o.eg;
      int i = o.dg;
      paramArrayOfg_[this.c.f()] = paramg_;
      this.b = paramg_;
      v localv = paramz1.f();
      if (localv != null) {}
      while (bool)
      {
        e locale = (e)localv.c();
        if (i != 0) {
          return;
        }
        if (!bool)
        {
          if (locale == this.c)
          {
            paramz1.h(localv);
            paramg_.g.add(locale);
            this.b = paramg_;
          }
        }
        else
        {
          zc localzc = ((o)locale.g()).k(locale);
          k.a(paramg_.k, new Rectangle2D.Double(localzc.a(), localzc.b(), localzc.c(), localzc.d()), paramg_.k);
          return;
        }
        localv = localv.a();
        if (i == 0) {
          break;
        }
      }
      paramz1.add(this.c);
    }
  }
  
  private static class d_
    extends x.b_
  {
    boolean c;
    double d;
    
    protected d_(double paramDouble, boolean paramBoolean)
    {
      super();
      this.c = paramBoolean;
      this.d = paramDouble;
    }
    
    public double a()
    {
      return this.d;
    }
    
    public void a(z paramz1, z paramz2, x.g_ paramg_, x.e_[][] paramArrayOfe_, x.g_[] paramArrayOfg_) {}
    
    public String toString()
    {
      return "BlockEvent{x = " + this.a + ", begin=" + this.c + ", extent=" + this.d + '}';
    }
  }
  
  private static class e_
    extends x.b_
  {
    static final byte c = 0;
    static final byte d = 1;
    static final byte e = 2;
    private final d f;
    private final a.d.w g;
    private int h;
    private final byte i;
    double j;
    int k;
    
    public e_(d paramd, a.d.w paramw, int paramInt, byte paramByte)
    {
      super();
      this.f = paramd;
      this.g = paramw;
      this.h = paramInt;
      this.i = paramByte;
    }
    
    public double a()
    {
      boolean bool = o.eg;
      if (!bool) {
        if (this.i == 1) {
          return this.a;
        }
      }
      e locale;
      o localo;
      zc localzc;
      if (!bool)
      {
        if (this.i == 0)
        {
          locale = this.f.e();
          localo = (o)locale.g();
          localzc = localo.d(locale);
          return Math.max(this.a, localzc.a() + localzc.c());
        }
        if (bool) {}
      }
      else if (this.i == 2)
      {
        locale = this.f.f();
        localo = (o)locale.g();
        localzc = localo.d(locale);
        return Math.max(this.a, localzc.a() + localzc.c());
      }
      return this.a;
    }
    
    public void a(z paramz1, z paramz2, x.g_ paramg_, e_[][] paramArrayOfe_, x.g_[] paramArrayOfg_)
    {
      boolean bool = o.eg;
      int i1 = o.dg;
      this.b = paramg_;
      Rectangle2D.Double localDouble = this.b.k;
      k.a(localDouble, new Rectangle2D.Double(this.g.a, this.g.b, 1.0D, 1.0D), localDouble);
      if ((bool) || (this.i != 0))
      {
        if (bool) {
          break label205;
        }
        if (this.i != 2) {}
      }
      else
      {
        v localv1 = paramz2.f();
        do
        {
          if (localv1 == null) {
            break;
          }
          e_ locale_1 = (e_)localv1.c();
          if (bool) {
            break label187;
          }
          if (i1 != 0) {
            break label185;
          }
          if ((bool) || (locale_1.f == this.f))
          {
            if (bool) {
              continue;
            }
            if (locale_1.h == this.h)
            {
              paramz2.h(localv1);
              paramg_.h.add(this);
              return;
            }
          }
          localv1 = localv1.a();
        } while (i1 == 0);
        if (!bool) {
          paramz2.add(this);
        }
        label185:
        label187:
        if ((!bool) && (i1 == 0)) {
          return;
        }
      }
      if (!bool)
      {
        if (this.i == 1) {
          label205:
          paramArrayOfe_[this.f.d()][(this.h + 1)].b = paramg_;
        }
      }
      else
      {
        int m = 0;
        int n = 0;
        v localv2 = paramz2.f();
        do
        {
          if (localv2 == null) {
            break;
          }
          e_ locale_2 = (e_)localv2.c();
          if (bool) {
            break label419;
          }
          if (i1 != 0) {
            break label417;
          }
          if ((bool) || (locale_2.f == this.f))
          {
            if (!bool)
            {
              if (locale_2.h == this.h)
              {
                paramz2.h(localv2);
                paramg_.h.add(this);
                m = 1;
                if ((!bool) && (n != 0)) {
                  break;
                }
              }
              if (bool) {
                continue;
              }
            }
            if (locale_2.h == this.h + 1)
            {
              paramz2.h(localv2);
              paramg_.h.add(locale_2);
              n = 1;
              if (bool) {
                continue;
              }
              if (m != 0) {
                break;
              }
            }
          }
          localv2 = localv2.a();
        } while (i1 == 0);
        if ((!bool) && (!bool)) {
          if (m == 0) {
            paramz2.add(this);
          }
        }
        label417:
        label419:
        if ((bool) || (n == 0)) {
          paramz2.add(new e_(this.f, this.g, this.h + 1, (byte)0));
        }
      }
    }
    
    public String toString()
    {
      return "EdgeEvent{edge=" + this.f + ", point=" + this.g + ", index=" + this.h + ", type=" + this.i + ", x=" + this.a + '}';
    }
  }
  
  private static final class g_
  {
    double a;
    double b;
    double c;
    int e;
    final z g = new z();
    final z h = new z();
    final z j = new z();
    final Rectangle2D.Double k = new Rectangle2D.Double(0.0D, 0.0D, -1.0D, -1.0D);
    z l;
    
    public g_(double paramDouble)
    {
      this.a = paramDouble;
    }
  }
  
  private static abstract class b_
  {
    double a;
    x.g_ b;
    
    protected b_(double paramDouble)
    {
      this.a = paramDouble;
    }
    
    public abstract double a();
    
    public abstract void a(z paramz1, z paramz2, x.g_ paramg_, x.e_[][] paramArrayOfe_, x.g_[] paramArrayOfg_);
  }
  
  private static class f_
    implements Comparator
  {
    private f_() {}
    
    public int compare(Object paramObject1, Object paramObject2)
    {
      boolean bool = o.eg;
      x.b_ localb_1 = (x.b_)paramObject1;
      x.b_ localb_2 = (x.b_)paramObject2;
      int i = l.a(localb_1.a, localb_2.a);
      if (!bool) {
        if (i != 0) {
          return i;
        }
      }
      if (!bool) {
        if ((localb_1 instanceof x.c_)) {
          return a((x.c_)localb_1, localb_2);
        }
      }
      if (!bool) {
        if ((localb_1 instanceof x.e_)) {
          return a((x.e_)localb_1, localb_2);
        }
      }
      if ((bool) || ((localb_1 instanceof x.d_))) {
        return a((x.d_)localb_1, localb_2);
      }
      throw new RuntimeException("unkown event type!");
    }
    
    private static int a(x.e_ parame_, x.b_ paramb_)
    {
      boolean bool = o.eg;
      if (!bool) {
        if ((paramb_ instanceof x.e_))
        {
          x.e_ locale_ = (x.e_)paramb_;
          int i = l.a(locale_.f.d(), parame_.f.d());
          if (!bool) {
            if (i == 0)
            {
              i = l.a(locale_.h, parame_.h);
              if (!bool) {
                if (i == 0) {
                  return l.a(locale_.i, parame_.i);
                }
              }
              return i;
            }
          }
          return i;
        }
      }
      if (!bool) {
        if ((paramb_ instanceof x.d_))
        {
          if (!bool) {}
          return ((x.d_)paramb_).c ? 1 : -1;
        }
      }
      return -1;
    }
    
    private static int a(x.c_ paramc_, x.b_ paramb_)
    {
      boolean bool = o.eg;
      if (!bool) {
        if ((paramb_ instanceof x.c_))
        {
          x.c_ localc_ = (x.c_)paramb_;
          if (!bool) {
            if (localc_.e != paramc_.e)
            {
              if (!bool) {}
              return paramc_.e ? -1 : 1;
            }
          }
          return l.a(localc_.c.f(), paramc_.c.f());
        }
      }
      if (!bool) {
        if ((paramb_ instanceof x.d_))
        {
          if (!bool) {}
          return ((x.d_)paramb_).c ? 1 : -1;
        }
      }
      return 1;
    }
    
    private static int a(x.d_ paramd_, x.b_ paramb_)
    {
      boolean bool = o.eg;
      if (!bool) {
        if ((paramb_ instanceof x.d_))
        {
          if (bool) {
            break label39;
          }
          if (((x.d_)paramb_).c == paramd_.c) {
            return 0;
          }
        }
      }
      label39:
      if (!bool) {}
      return paramd_.c ? -1 : 1;
    }
    
    f_(x.0 param0)
    {
      this();
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.getDefaultLicenseInfoEx

 * JD-Core Version:    0.7.0.1

 */